home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EuroCD 3
/
EuroCD 3.iso
/
Graphics_Utils
/
PovRay_040
/
POVRay3
/
pov3demo
/
objects
/
ttftest.pov
< prev
Wrap
Text File
|
1998-06-24
|
3KB
|
100 lines
// Persistence Of Vision raytracer version 3.0 sample file.
// Author: Andreas Dilger, Feb 1996
#version 3.0
global_settings { assumed_gamma 1.0 }
camera {
location <0, 0, -14>
direction <0, 0, 1>
up <0, 1, 0>
right <4/3, 0, 0>
look_at <0, 0, 0>
}
light_source {<-100, 100, -100> colour rgb <1.5, 1.5, 1.5>}
#declare FontName = "cyrvetic.ttf"
#declare FontTexture =
texture {
pigment { color rgb <0.1, 0.2, 0.5> }
finish {
ambient 0.2
diffuse 0.6
phong 0.3
phong_size 100
}
}
#declare height = 1 // Size of characters
#declare length = 16 // Number of characters in a row
// ISO 8859-1 only defines printable characters in the range 32-126 and 160-255
#declare startchar1 = 32 // First character to render
#declare endchar1 = 126 // Last character to render in the first group
#declare startchar2 = 160 // First character to render in the second group
#declare endchar2 = 255 // Last characrer to render
#render concat("\nThis file renders the characters from ",
str(startchar1, 0, 0), " - ", str(endchar1, 0, 0), " and ",
str(startchar2, 0, 0), " - ", str(endchar2, 0, 0), "\n")
#render "using the ISO 8859-1 (Latin-1) character set (if available).\n\n"
#render "Some of the characters may not be rendered properly (usually\n"
#render "shown by a hollow box []), usually because they do not exist, or\n"
#render "sometimes because the POV-Ray code does not yet support the\n"
#render "encoding format used by these characters.\n\n"
#declare Xoff = -9
// Calculate the starting Y offset based on how many rows there are
#declare Yoff = ((int((endchar1 - startchar1 + length)/length) +
int((endchar2 - startchar2 + length)/length))/2-1)*height
plane { -z, -0.01 pigment { checker color rgb <0.9, 0.9, 0.9>,
color rgb <0.7, 0.7, 0.7>
translate <0, Yoff, 0> }
}
#declare char = startchar1
#while (char <= endchar2)
#declare string = concat(str(char, -3, 0), "-")
#declare pos = 0
#while (pos < length)
// We want only to print the characters from 32 - 126 and 160 - 255
#switch (char + pos)
#range (endchar1 + 1, startchar2 - 1)
#declare char = startchar2 - length // make sure increment is calculated right
#declare pos = length // break out of the inner loop
#break
#range (startchar1, endchar1) // These are the printing characters
#range (startchar2, endchar2)
#declare string = concat(string, chr(char + pos))
#break
#end // switch (char + pos)
#declare pos = pos + 1
#end // while (pos < length)
text { ttf
FontName,
string,
1, 0
texture { FontTexture }
scale <height, height, 0.5>
translate <Xoff, Yoff, 0>
}
#declare Yoff = Yoff - height
#declare char = char + length
#end // while (char <= endchar2)